<?php

use yii\widgets\ActiveForm;
use kartik\select2\Select2;
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */

$this->title = '修改';
$this->params['breadcrumbs'][] = ['label' => '档案管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;

?>

<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">基本信息</h3>
            </div>
            <div class="box-body">
                <?php $form = ActiveForm::begin([
                    'fieldConfig' => [
//                        'template' => "<div class='col-sm-1 text-right'>{label}</div><div class='col-sm-11'>{input}\n{hint}\n{error}</div>",
                    ],
                ]); ?>
                <div class="col-sm-12">
                    <?= $form->field($model, 'cate_id')->widget(Select2::class, [
                        'data' => $cates,
                        'options' => ['placeholder' => '请选择'],
                        'pluginOptions' => [
                            'allowClear' => true
                        ],
                    ]);?>
                    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
                    <?= $form->field($model, 'serial')->textInput() ?>
                    <?= $form->field($model, 'cabinet')->textInput() ?>
                    <?= $form->field($model, 'box')->textInput() ?>
                    <?= $form->field($model, 'send_time')->widget('kartik\date\DatePicker', [
                        'language' => 'zh-CN',
                        'layout' => '{picker}{input}',
                        'pluginOptions' => [
                            'format' => 'yyyy-mm-dd',
                            'todayHighlight' => true,// 今日高亮
                            'autoclose' => true,// 选择后自动关闭
                            'todayBtn' => true,// 今日按钮显示
                        ],
                        'options' => [
                            'class' => 'form-control no_bor',
                        ]
                    ]); ?>
                    <?= $form->field($model, 'covers')->widget(common\widgets\webuploader\Files::class, [
                        'config' => [
                            'pick' => [
                                'multiple' => true,
                            ],
                        ]
                    ])->hint('第一张图片将作为主图,支持同时上传多张图片,多张图片之间可拖动调整位置'); ?>
                </div>
                <div class="form-group">
                    <div class="col-sm-12 text-center">
                        <button class="btn btn-primary" type="submit">保存</button>
                        <span class="btn btn-white" onclick="history.go(-1)">返回</span>
                    </div>
                </div>
                <?php ActiveForm::end(); ?>
            </div>
        </div>
    </div>
</div>
